@extends('layout.layout')

@section('content')
   <h1 class="page-title">新闻修改 <small></small></h1>
    <div class="widget">
    	<div class="widget">
                    <form action="{{url('/admin/news/update')}}" method="post" enctype="multipart/form-data">
                        <div class="widget-header">
                            <h4>选择分类</h4>
                        </div>

                        <div>
                            <select class="span5" name="pid" id="select-box" style="background: rgba(0,0,0,0.5)">
                             	 @foreach($cates as $k=>$v)
                                    <option value="{{$v->id}}" @if($v->id == $news->pid) selected @endif>{{$v->name}}</option>
                                 @endforeach   
                            </select>
                            <br />
                        </div>
                        <h4>标题</h4>
                        <input name="title" class="span5" id="focusedInput" type="text" value="{{$news->title}}" />
                        <br />
                        
                       
					
						<div class="widget-header">
							<h4>内容</h4>
						</div> 
								<textarea name="contents" class="textarea input-block-level" id="wysihtml5" placeholder="" rows="12">{{$news->contents}}</textarea>
                        <h4>新闻封面</h4>
                        <input id="pic" name="pic" type="file">
                        <img width="200px" height="200px" src="/public/newsimage/{{ $news->pic }}" alt="">
                        <input id="imgID"  type="hidden" name="id" value="">
                        <br />
                        <h4>置顶</h4>
                        <select class="span5" name="status" id="select-box" style="background: rgba(0,0,0,0.5)">
                                <option value="1" @if($news->status == 1) selected @endif>置顶</option>   
                                <option value="2" @if($news->status == 2) selected @endif>普通</option>    
                            </select>
                            <br />
                        <input type="hidden" name="id" value="{{$news->id}}">
                        {{csrf_field()}}
                        <button type="submit" class="btn btn-primary icon-ok">修改新闻</button>
                        <button type="reset" class="btn icon-refresh">重置</button>
                   
                    </form>
         </div>           
    </div>                          
@endsection